package kpython.backend.semantic;

/**
 * 
 * Um Record corresponde a um registo de um simbolo dentro de um scope
 * 
 * @author Dinis
 *
 */
public abstract class Record {

    /**
     * Construtor da classe
     * 
     * @param line
     * @param symbol
     */
    public Record(int line, Symbol symbol) {
        this.line = line;
        this.symbol = symbol;
        
    }

    public Record(int line, int col, Symbol symbol) {
        this.line = line;
        this.column = col;
        this.symbol = symbol;
    }
    
    public Record(int line, int col, Symbol symbol, Type type) {
        this.line = line;
        this.column = col;
        this.symbol = symbol;
        this.type = type;
    }

    public int getColumn() {
        return column;
    }

    /**
     * Devolve a linha 
     * 
     * @return line
     */
    public int getLine() {
        return line;
    }

    /**
     * Devolve o s�mbolo
     * 
     * @return symbol
     */
    public Symbol getSymbol() {
        return symbol;
    }

    public Type getType() {
        return type;
    }
    
    public void setType(Type t) {
        this.type = t;
    }
    
    /**
     * Linha correspondente
     */
    private int line = -1;
    private int column = -1;
    
    private int scopeId = -1;

    public int getScopeId() {
        return scopeId;
    }

    public void setScopeId(int scopeId) {
        this.scopeId = scopeId;
    }
    /**
     * S�mbolo a que o record corresponde
     */
    private Symbol symbol = null;
    
    private Type type = Type.unknownType;
}
